package com.ahem.demo.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ahem.demo.entity.po.TTest;
import com.ahem.demo.mapper.TTestMapper;
import com.ahem.demo.mapper.TestXmlMapper;

/**
 * 测试操作数据库service
 * 
 * @author fangzhixian
 *
 */
@Service
public class DbService {
	@Autowired
	TTestMapper mapper;
	
	@Autowired
	TestXmlMapper xmlMapper;

	public TTest findById(Integer id) {
		return mapper.selectByPrimaryKey(id);
	}
	
	public int getRowCount(Integer id) {
		Map<String, Object> map = new HashMap<>();
		map.put("id", id);
		return xmlMapper.getRowCount(map);
	}

}
